/****************************************************
          File Name:15-3.h
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sun Jan 11 18:24:26 2015
*****************************************************/

#ifndef HEAD_H_
#define HEAD_H_

#include <iostream>
#include <stdexcept>

class hmeanexcp : public std::logic_error
{
    private:
        double a;
        double b;
    public:
        hmeanexcp(double x, double y): a(x), b(y),
        std::logic_error("hmean() invalid argument: a = -b\n") {};
        void msg() { std::cout << a << " and " << b << " in hmean()\n"; }
};

class gmeanexcp : public std::logic_error
{
    private:
        double a;
        double b;
    public:
        gmeanexcp(double x, double y): a(x), b(y),
        std::logic_error("gmean() argument should be >=0\n") {}
        void msg() { std::cout << a << " and " << b << " in gmean\n"; }
};

#endif
